﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPlus.Master" AutoEventWireup="true" CodeBehind="wbfrm_Respaldos.aspx.cs" Inherits="FrontEndPlus.Módulos.Seguridad.wbfrm_Respaldos" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="ajax" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <meta charset="utf8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <link type="text/css" rel="stylesheet" href="../../App_Themes/CSS/Smoke.css" />
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js?ver=1.4.2"></script>
    <script type="text/javascript" src="../../JS/Smoke.js"></script>
    <script type="text/javascript" src="../../JS/Smoke.min.js"></script>
    
    <meta name="description" content="A lightweight, customizable jQuery timepicker plugin inspired by Google Calendar. Add a user-friendly javascript timepicker dropdown to your app in minutes." />
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
    <script type="text/javascript" src="../../JS/Jquery.timepicker.js"></script>
    <link rel="stylesheet" type="text/css" href="../../App_Themes/CSS/Jquery.timepicker.css" />

    <script type="text/javascript">
        $(function () {
            $('#txt_Hora').timepicker();
            $('#txt_Hora').timepicker({ 'step': 60 });
            $('#txt_Hora').useSelect('false');
        });

        function ConfirmOnDelete() {
            if (confirm("Al realizar este proceso se realizara un respaldo en el servidor FTP predeterminado \nLuego se restaurara la base de datos que selecciono y se cerrara la sesion \nDesea continuar?") == true)
                return true;
            else
                return false;
        }
            </script>
    <style type="text/css">
    .fancy-green .ajax__tab_header
    {
	background: url(../../App_Themes/Resources/blue_bg_Tab.gif) repeat-x;
	cursor:pointer;
}
.fancy-green .ajax__tab_hover .ajax__tab_outer, .fancy-green .ajax__tab_active .ajax__tab_outer
{
	background: url(../../App_Themes/Resources/blue_left_Tab.gif) no-repeat left top;
}
.fancy-green .ajax__tab_hover .ajax__tab_inner, .fancy-green .ajax__tab_active .ajax__tab_inner
{
	background: url(../../App_Themes/Resources/blue_right_Tab.gif) no-repeat right top;
}
.fancy .ajax__tab_header
{
	font-size: 13px;
	font-weight: bold;
	color: #000;
	font-family: sans-serif;
}
.fancy .ajax__tab_active .ajax__tab_outer, .fancy .ajax__tab_header .ajax__tab_outer, .fancy .ajax__tab_hover .ajax__tab_outer
{
	height: 46px;
}
.fancy .ajax__tab_active .ajax__tab_inner, .fancy .ajax__tab_header .ajax__tab_inner, .fancy .ajax__tab_hover .ajax__tab_inner
{
	height: 46px;
	margin-left: 16px; /* offset the width of the left image */
}
.fancy .ajax__tab_active .ajax__tab_tab, .fancy .ajax__tab_hover .ajax__tab_tab, .fancy .ajax__tab_header .ajax__tab_tab
{
	margin: 16px 16px 0px 0px;
}
.fancy .ajax__tab_hover .ajax__tab_tab, .fancy .ajax__tab_active .ajax__tab_tab
{
	color: #fff;
}
.fancy .ajax__tab_body
{
	font-family: Arial;
	font-size: 10pt;
	border-top: 0;
	border:1px solid #999999;
	padding: 8px;
	background-color: #ffffff;
}

        .fancy-green {}
        .fancy-green {}
        .fancy-green {}

        .fancy-green {}
        .fancy-green {}
        .fancy-green {}

        .auto-style2 {
            height: 44px;
            text-align:center;
        }

        .auto-style6 {
            text-align: center;
            height: 22px;
            width: 305px;
        }
        .auto-style7 {
            width: 307px;
            text-align: center;
            height: 22px;
        }
        .auto-style9 {
            width: 307px;
            text-align: center;
            height: 27px;
        }
        .auto-style10 {
            width: 305px;
            text-align: center;
            height: 28px;
        }
        .auto-style11 {
            width: 307px;
            text-align: center;
            height: 28px;
        }
        .auto-style12 {
            width: 255px;
            text-align: center;
            height: 31px;
        }
        .auto-style14 {
            width: 282px;
            text-align: center;
            height: 30px;
        }
        .auto-style15 {
            width: 307px;
            text-align: center;
            height: 30px;
        }
        .auto-style16 {
            height: 92px;
            text-align: center;
        }
        .auto-style17 {
            text-align: center;
            height: 43px;
        }

        .auto-style20 {
            width: 217px;
            text-align: center;
            height: 18px;
        }
        .auto-style21 {
            width: 307px;
            text-align: center;
            height: 18px;
        }

        #basicExample {
            width: 78px;
        }

        #txt_Hora {
            width: 63px;
        }

        .auto-style22 {
            text-align: center;
            height: 39px;
        }
        .fancy-green {}

        .fancy-green {}
        .fancy-green {}

        .auto-style23 {
            width: 305px;
            text-align: center;
            height: 30px;
        }
        .auto-style24 {
            width: 283px;
            text-align: center;
            height: 31px;
        }
        .auto-style25 {
            width: 307px;
            text-align: center;
            height: 31px;
        }
        .auto-style26 {
            width: 323px;
            text-align: center;
            height: 30px;
        }
        .auto-style27 {
            width: 323px;
            text-align: center;
            height: 27px;
        }
        .auto-style28 {
            width: 323px;
            text-align: center;
            height: 28px;
        }
        .auto-style29 {
            width: 323px;
            text-align: center;
            height: 31px;
        }
        .auto-style30 {
            width: 323px;
            text-align: center;
            height: 22px;
        }

    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:Panel ID="Panel3" runat="server" Height="494px" Width="207px">
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <asp:Image ID="Image2" runat="server" Height="196px" ImageUrl="~/App_Themes/Resources/base_datos.png" Width="206px" />
    </asp:Panel>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
    <ajax:ToolkitScriptManager ID="ScriptManager1" runat="server">
    </ajax:ToolkitScriptManager>    
    <ajax:TabContainer ID="TC_Respaldos" runat="server" CssClass="fancy fancy-green" ActiveTabIndex="2" Width="728px" Height="582px">
    <ajax:TabPanel ID="tbpnluser" runat="server" >
    <HeaderTemplate>
        Respaldo Locales
    </HeaderTemplate>
        <ContentTemplate>
            <br/>
            <br />
            <br />
            <br/>
        <asp:Panel ID="Panel1" runat="server" Height="405px" Width="704px">
        <table align="center" border="1px" style="margin-bottom: 0px; width: 481px; height: 378px;">
            <tr>
                <td align="center" colspan="2" class="auto-style2" >
                    <b>Detalles de la Base de Datos</b>
                </td>
            </tr>
            <tr>
                <td align="right" class="auto-style26">
                    Nombre de la Base de datos:
                </td>
                <td class="auto-style15">
                    DBGimnasio
                </td>
            </tr>
            <tr>
                <td align="right" class="auto-style27">
                    Cantidad de tablas:
                </td>
                <td class="auto-style9">
                    &nbsp;<asp:Label ID="lbl_Tablas" runat="server"></asp:Label>
                </td>
            </tr>
            <tr>
                <td align="right" class="auto-style28">
                    Cantidad de Store Procedure:
                </td>
                <td class="auto-style11">
                    <asp:Label ID="lbl_SPS" runat="server"></asp:Label>
                </td>
            </tr>
            <tr>
                <td align="right" class="auto-style29">
                    Tamaño de la Base de Datos:
                </td>
                <td class="auto-style25">
                    <asp:Label ID="lbl_Tamano" runat="server"></asp:Label>
                </td>
            </tr>
            <tr>
                <td align="right" class="auto-style30" >
                    Formato de Creacion:
                </td>
                <td class="auto-style7">
                    .BAK
                </td>
            </tr>
            <tr>
                <td align="right" class="auto-style29">Gimnasio: </td>
                <td class="auto-style25">
                    <asp:DropDownList ID="cb_Gimnasios_Respaldos" runat="server" Height="24px" Width="133px">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td align="right" class="auto-style17" colspan="2">Ruta de descarga:<asp:TextBox ID="txt_Ruta_Local" runat="server" Height="17px" Width="228px" style="text-transform: uppercase;" onblur="javascript:this.value=this.value.toUpperCase();"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td align="right" class="auto-style16" colspan="2">
                    <asp:Button ID="btn_Respaldar" runat="server" Height="59px" OnClick="btn_Respaldar_Click" Text="Respaldar" Width="143px" />
                </td>
            </tr>
    </table>
    </asp:Panel>
    </ContentTemplate>
    </ajax:TabPanel>
    <ajax:TabPanel ID="tbpnlusrdetails" runat="server" >
    <HeaderTemplate>
        Respaldos Programados
    </HeaderTemplate>
    <ContentTemplate>
        <asp:Panel ID="Panel4" runat="server" Height="524px" Width="708px">
            <br/><br/>
        <table align="center" border="1px" style="margin-bottom: 0px; width: 463px; height: 463px;">
            <tr>
                <td align="center" colspan="2" class="auto-style22" >
                    Parametros del horario de guardado
                </td>
            </tr>
            <tr>
                <td align="right" class="auto-style12">
                    Gimnasio:
                </td>
                <td class="auto-style25">
                    <asp:DropDownList ID="cb_Gimnasios_Programado" runat="server" Height="24px" Width="133px">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td align="right" class="auto-style20">
                    Dias en los que se va a respaldar:
                </td>
                <td class="auto-style21">
                    <asp:CheckBox ID="chb_Lunes" runat="server" Text="Lunes" />
                    <br />
                    <asp:CheckBox ID="chb_Martes" runat="server" Text="Martes" />
                    <br />
                    <asp:CheckBox ID="chb_Miercoles" runat="server" Text="Miércoles" />
                    <br />
                    <asp:CheckBox ID="chb_Jueves" runat="server" Text="Jueves" />
                    <br />
                    <asp:CheckBox ID="chb_Viernes" runat="server" Text="Viernes" />
                    <br />
                    <asp:CheckBox ID="chb_Sabado" runat="server" Text="Sábado" />
                    <br />
                    <asp:CheckBox ID="chb_Domingo" runat="server" Text="Domingo" />
                </td>
            </tr>
            <tr>
                <td align="right" class="auto-style10">
                    Hora del respaldo:
                </td>
                <td class="auto-style11">
                    <asp:TextBox ID="txt_Hora" type="text" class="time" runat="server" ClientIDMode="Static"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td align="right" class="auto-style17" colspan="2" >
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Ruta FTP:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <asp:TextBox ID="txt_Ruta_Programada" runat="server" Height="16px" Width="188px" autocomplete="off"></asp:TextBox>
                    <br />
                    <br />
                    &nbsp;Usuario FTP:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <asp:TextBox ID="txt_Usuario_Programado" runat="server" Height="16px" Width="135px" autocomplete="off" autocompletetype="Disabled" ></asp:TextBox>
                    <br />
                    <br />
                    Password FTP:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <asp:TextBox ID="txt_Password_Programado" runat="server" Height="16px" Width="135px" type="password" autocomplete="off" autocompletetype="Disabled" ></asp:TextBox>
                    <br />
                    <br />
                </td>
            </tr>
            <tr>
                <td align="right" class="auto-style16" colspan="2">
                    <asp:Button ID="btn_Guarda_Parametros" type="submit" runat="server" Height="59px" OnClick="btn_Guarda_Parametros_Click" Text="Guardar Parametros" Width="143px" />
                </td>
            </tr>
    </table>
    </asp:Panel>
    </ContentTemplate>
    </ajax:TabPanel>
    <ajax:TabPanel ID="tbpnljobdetails" runat="server" >
    <HeaderTemplate>
        Restauracion de Base de datos<br />
    </HeaderTemplate>
    <ContentTemplate>
            <br/>
            <br />
            <br />
            <br/>
        <asp:Panel ID="Panel2" runat="server" Height="405px" Width="704px">
        <table align="center" border="1px" style="margin-bottom: 0px; width: 475px; height: 344px;">
            <tr>
                <td align="center" colspan="2" class="auto-style2" >
                    Restauracion de base de Datos</td>
            </tr>
            <tr>
                <td align="right" class="auto-style14">
                    Conexiones existentes:
                </td>
                <td class="auto-style23">
                    1
                </td>
            </tr>
            <tr>
                <td align="right" class="auto-style6">
                    Formato de Subida:
                </td>
                <td class="auto-style7">
                    .BAK
                </td>
            </tr>
            <tr>
                <td align="right" class="auto-style12">Seleccione un archivo: </td>
                <td class="auto-style24">
                    <asp:FileUpload ID="fu_Base_Datos" runat="server" Height="26px" Width="231px" />
                </td>
            </tr>
            <tr>
                <td align="right" class="auto-style16" colspan="2">
                    <asp:Button ID="btn_Upload" runat="server" Height="59px" Text="Upload" Width="143px" OnClick="btn_Upload_Click" OnClientClick="return ConfirmOnDelete();"/>
                </td>
            </tr>
    </table>
    </asp:Panel>
    </ContentTemplate>
    </ajax:TabPanel>
    </ajax:TabContainer>
    </asp:Content>
